<?php

namespace App\Http\Controllers\Admin;

use App\models\AdminModule;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class PermissionController extends Controller
{
    public function index()
    {
        $modules = AdminModule::get();
        return view('admin.permission_index',compact('modules'));
    }

//    更新权限缓存
    public function cache()
    {
        app()['cache']->forget('spatie.permission.cache');
        return back()->with('success','权限缓存更新成功');
    }
}
